package com.springblog.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 
 * </p>
 *
 * @author ifredom@gmail.com
 * @since 2022-04-23
 */
@Data
@TableName("m_blog")
public class BlogEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 文章id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 标题
     */
    @NotBlank(message="标题不能为空")
    private String title;

    /**
     * 描述
     */
    private String description;

    /**
     * 正文内容
     */
    private String content;

    /**
     * 创建时间
     */
    private LocalDateTime created;

    /**
     * 文章状态
     */
    private Integer status;


}
